﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Input
{
    using Acoris.Foundation;

    /// <summary>
    /// 表示输入管理器
    /// </summary>
    public sealed class InputManager
    {
        private PlainTrieTree plainTrieTree;

        public InputManager()
        {
            plainTrieTree = new PlainTrieTree();
        }

        #region Dictionary Add / Remove / Clear

        /// <summary>
        /// 清空当前集合
        /// </summary>
        public void Clear()
        {
            plainTrieTree.Clear();
        }

        public void Add(string keyword)
        {
            plainTrieTree.AppendString(keyword, null);
        }

        public void AddRange(IEnumerable<string> keywords)
        {
            // TODO: can save the time spent?
            foreach (var keyword in keywords) {
                Add(keyword);
            }
        }

        #endregion

    }
}
